<div class="bjui-pageHeader">
    <div class="pull-right">
    <if condition="I('type') eq '2'">
        <input type="checkbox" name="lookupType" value="1" data-toggle="icheck" data-label="追加" checked>
         <button type="button" class="btn-blue" data-toggle="lookupback" data-lookupid="ids" data-warn="请至少选择一项" data-icon="check-square-o">选择勾选</button>
    <else/>
        <button class="btn-default" data-icon="plus" title="新增属性" data-toggle="tooltip" data-placement="left" onclick="createDialog('{:U("Forms/attr")}', '新增属性', 'attr', {width:700, height:500})"></button>
        <a href="{:U('Forms/del_attr')}" class="btn btn-default" data-toggle="doajaxchecked" data-icon="remove" data-callback="callbackRefres" data-confirm-msg="要删除全部选中的吗??" data-idname="id" data-group="ids"></a>
        <button class="btn-default" data-icon="refresh" onclick="$.CurrentNavtab.navtab('refresh')"></button>
    </if>
    </div>
    <form id="pagerForm" data-toggle="ajaxsearch" data-loadingmask="true" action="{:U('attr')}" method="post">
        <input type="hidden" name="pageSize" value="{:I('param.pageSize')}" />
        <input type="hidden" name="pageCurrent" value="{:I('param.pageCurrent')}" />
        <input type="hidden" name="orderField" value="{:I('param.orderField')}" />
        <input type="hidden" name="orderDirection" value="{:I('param.orderDirection')}" />
        <input type="hidden" name="type" value="{:I('type')}"/>
        <div class="bjui-searchBar">
            <label>规格名称:</label>
            <input type="text" name="name" value="{:I('name')}"/>
            <button type="submit" class="btn-default" data-icon="search">查询</button>
            <a class="btn btn-orange" href="javascript:;" data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">清空查询 </a>
        </div>
    </form>
</div>
<div class="bjui-pageContent tableContent">
    <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="false">
        <thead>
            <tr>
                <th width="26"><input type="checkbox" class="checkboxCtrl" data-group="ids" data-toggle="icheck"></th>
                <th>属性名称</th>
                <th>输入方式</th>
                <th>可选值</th>
                <th width="50">筛选</th>
                <th width="50">权重</th>
                <th width="100">操作</th>
            </tr>
        </thead>
        <tbody>
        <volist name="list" id="vo">
        <php>
	        switch($vo['type']){
	           case '1':
	             $typename = "单选";
	           break;
	           case '2':
	             $typename = "多选";
	           break;
	           case '3':
	             $typename = "下拉";
	           break;
	           case '4':
	             $typename = "文本输入";
	           break;
	           case '5':
	             $typename = "多行文本输入";
	           break;
	        };
        </php>
        <tr>
            <if condition="I('type') eq '2'">
               <td width="26"><input type="checkbox" value="{id:<php>echo $vo['id']</php>, attr_name:'<php>echo $vo['name']</php>',attr_input:'<php>echo $typename</php>',attr_item:'<php>echo str_replace(',','_',$vo['value'])</php>'}" class="checkboxCtrl" name="ids" data-toggle="icheck"></td>
            <else/>
               <th width="26"><input type="checkbox" value="{$vo.id}" class="checkboxCtrl" name="ids" data-toggle="icheck"></th>
            </if>
            <td>{$vo.name}</td>
            <td>
            {$typename}
            </td>
            <td>{$vo.value}</td>
            <td><if condition="$vo.search eq '0'">否<else/>是</if></td>
            <td>{$vo.sort}</td>
            <td>
            <if condition="I('type') eq '2'">
                <button type="button" class="btn-green" data-toggle="lookupback" data-args="{id:<php>echo $vo['id']</php>, attr_name:'<php>echo $vo['name']</php>',attr_input:'<php>echo $typename</php>',attr_item:'<php>echo str_replace(',','_',$vo['value'])</php>'}">选</button>
            <else/>
                <button type="button" class="btn-blue" onclick="createDialog('{:U("Forms/attr",array("id"=>$vo["id"]))}', '修改属性', 'attr' ,{width:700, height:500})">改</button>
                <a href="{:U('Forms/del_attr',array('id'=>$vo['id']))}" data-type="get" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除这个属性?" >删</a>
            </if>
            </td>
        </tr>
        </volist>
        </tbody>
    </table>
</div>
<include file="Common/footer" ftype="page" />